/// 创建人： Created by zhaolong
/// 创建时间：Created by  on 2020/7/23.
///
/// 创建人： Created by zhaolong
/// 创建时间：Created by  on 2020/9/25.
///
/// gongzhonghao biglead
/// https://study.163.com/instructor/1021406098.htm
/// https://blog.csdn.net/zl18603543572
/// https://www.toutiao.com/c/user/token/MS4wLjABAAAAYMrKikomuQJ4d-cPaeBqtAK2cQY697Pv9xIyyDhtwIM/

class RankUserStatBean {
  int userId;
  int obtainScore;
  int extractingTimes;
  int averageScore;
  int rankNumber;

  double rankIntegralNumber;

  String statisticsDate;
  String reamName;
  String userPost;
  String department;

  RankUserStatBean.fromJson(Map<String, dynamic> map) {
    this.userId = map["userId"];
    this.obtainScore = map["obtainScore"];
    this.extractingTimes = map["extractingTimes"];
    this.averageScore = map["averageScore"];
    this.rankNumber = map["rankNumber"];

    this.rankIntegralNumber = map["rankIntegralNumber"];

    this.statisticsDate = map["statisticsDate"];
    this.reamName = map["reamName"];
    this.userPost = map["userPost"];
    this.department = map["department"];
  }
}

class RankStatBean {
  RankUserStatBean userStatistics;
  List<RankUserStatBean> firstStatistics;
  List<RankUserStatBean> lastStatistics;

  RankStatBean.fromJson(Map<String, dynamic> map) {
    var userMap = map["userStatistics"];
    if (userMap != null) {
      this.userStatistics = RankUserStatBean.fromJson(userMap);
    }

    List list = map["firstStatistics"];
    if (list != null) {
      this.firstStatistics = [];
      list.forEach((element) {
        this.firstStatistics.add(RankUserStatBean.fromJson(element));
      });
    } else {
      this.firstStatistics = [];
    }

    List list2 = map["lastStatistics"];
    if (list2 != null) {
      this.lastStatistics = [];
      list2.forEach((element) {
        this.lastStatistics.add(RankUserStatBean.fromJson(element));
      });
    } else {
      this.lastStatistics = [];
    }
  }
}

/*
"monthStatistics": {
			"obtainScore": 2000,
			"extractingTimes": 2,
			"averageScore": 1000,
			"statisticsDate": "2020-01-01 00:00:00"
		},
		"dayStatistics": [{
			"obtainScore": 1000,
			"extractingTimes": 1,
			"averageScore": 1000,
			"answerTime": 6,
			"statisticsDate": "2020-01-08 00:00:00"
		}, {
			"obtainScore": 1000,
			"extractingTimes": 1,
			"averageScore": 1000,
			"answerTime": 5,
			"statisticsDate": "2020-01-10 00:00:00"
		}],
 */

class MonthStatisticItemBean {
  StatisticItemBean monthStatistics;
  List<StatisticItemBean> dayStatistics;

  MonthStatisticItemBean.fromJson(Map<String, dynamic> map) {
    var month = map["monthStatistics"];
    if (month != null) {
      this.monthStatistics = StatisticItemBean.fromJson(month);
    }
    List list = map["dayStatistics"];
    if (list != null) {
      this.dayStatistics = [];
      list.forEach((element) {
        this.dayStatistics.add(StatisticItemBean.fromJson(element));
      });
    } else {
      this.dayStatistics = [];
    }
  }
}

class StatisticItemBean {
  int obtainScore;
  int extractingTimes;

  int averageScore;
  int answerTime;
  String statisticsDate;

  StatisticItemBean.fromJson(Map<String, dynamic> map) {
    this.obtainScore = map["obtainScore"];
    this.extractingTimes = map["extractingTimes"];
    this.averageScore = map["averageScore"];

    this.answerTime = map["answerTime"];
    this.statisticsDate = map["statisticsDate"];
  }
}
